<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_aboutchannel.*" %>
<%@page import="java.util.*" %>
<% 
  	String ch_id="";
  	if(request.getParameter("ch_id")!=null) ch_id = request.getParameter("ch_id");
  	Ti_aboutchannelInfo ti_aboutchannelInfo = new Ti_aboutchannelInfo();
  	List list = ti_aboutchannelInfo.getListByPk(ch_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String ch_name="",ch_level="",up_ch_id="",order_no="",state="",ch_type="";
  	if(map.get("ch_name")!=null) ch_name = map.get("ch_name").toString();
  	if(map.get("ch_level")!=null) ch_level = map.get("ch_level").toString();
  	if(map.get("up_ch_id")!=null) up_ch_id = map.get("up_ch_id").toString();
  	if(map.get("order_no")!=null) order_no = map.get("order_no").toString();
  	if(map.get("state")!=null) state = map.get("state").toString();
  	if(map.get("ch_type")!=null) ch_type = map.get("ch_type").toString();
  	
  	String user_id="";
		if( session.getAttribute("session_user_id") != null )
		{
			user_id = session.getAttribute("session_user_id").toString();
		}
		
		String up_ch_name="";
		if(!up_ch_id.equals("")){
		up_ch_name = ti_aboutchannelInfo.getChName(up_ch_id);
		}
		if(up_ch_name.equals("")){
			up_ch_name="无上级栏目";
		}

	String ch_namex = "";
	if(request.getParameter("ch_namex")!=null && !request.getParameter("ch_namex").equals("")){
		ch_namex = request.getParameter("ch_namex");
		
	}
	
	String ch_idx = "";
	if (request.getParameter("up_ch_id")!=null && !request.getParameter("up_ch_id").equals("")) 
	{
		ch_idx = request.getParameter("up_ch_id");
	}
 	else
 	{
		ch_idx="000000000000000";
	}
	
	
	String n_aboutch_state = "";
	if(request.getParameter("aboutch_state")!=null && !request.getParameter("aboutch_state").equals("")){
		n_aboutch_state = request.getParameter("aboutch_state");
		
	}
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	String para =	"/program/admin/aboutchannel/index.jsp?ch_namex="+ch_namex+"&up_ch_id="+ch_idx+"&aboutch_state="+n_aboutch_state+"&iStart="+Integer.parseInt(iStart)+"&limit="+limit;	
 %>
<html>
  <head>
    
	  <title>修改栏目</title>
		<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="/js/commen.js"></script>
		<script type="text/javascript" src="aboutchannel.js"></script>
</head>

<body>
	<h1>修改栏目</h1>
	
	<form action="/doTradeReg.do" method="post" name="updateForm">
		<input name="ch_id" id="ch_id" type="hidden" value="<%=ch_id%>"/>
		<input name="user_id" id="user_id" type="hidden" value="<%=user_id%>"/>
		<input name="up_ch_id" type="hidden" id="up_ch_id" value="<%=up_ch_id%>" /></td>
		<input name="ch_level" type="hidden" id="ch_level" value="<%=ch_level%>" /></td>
	
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		<tr>
			<td align="right" width="15%">
				栏目标识:
			</td>
			<td colspan="3"><%=ch_id%></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				栏目名称<font color="red">*</font>
			</td>
			<td colspan="3"><input name="ch_name" id="ch_name" type="text"  maxLength="200" size="58"  value="<%=ch_name%>" onkeyup= "value=value.replace(/[\uFF00-\uFFFF]/g,''); "   onbeforepaste= "clearSBC(); "/></td>
				<tr>
					<td align="right" width="15%">
						级别:
					</td>
					<td><%=ch_level%></td>		 
					<td align="right" width="15%">
						排序:
					</td>
					<td>
						<input name="order_no" id="order_no" type="text" value="<%=order_no%>" size="5" maxlength="3" onKeyUp="if(!/^[0-9][0-9]*$/.test(this.value))this.value=''">&nbsp;( 由低 -> 高 )</td>
					</td>
				</tr>
		</tr>
		<tr>
			<td align="right" width="15%">
				上级栏目:
			</td>
			<td colspan="3"><%=up_ch_name%></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				状态:
			</td>
			<%if(state.equals("0")){%>
				<td colspan="3"><input name="state" type="radio" value="0" checked />&nbsp;显示
						<input name="state" type="radio" value="1" />&nbsp;隐藏</td>
			<%}else if(state.equals("1")){%>
				<td colspan="3"><input name="state" type="radio" value="0" />&nbsp;显示
						<input name="state" type="radio" value="1" checked />&nbsp;隐藏</td>
			<%}%>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				栏目类型:
			</td>
			<%if(ch_type.equals("0")){%>
				<td colspan="3"><input name="ch_type" type="radio" value="0" checked />&nbsp;列表页栏目
					 	<input name="ch_type" type="radio" value="1" />&nbsp;详细页栏目</td>
			<%}else if(ch_type.equals("1")){%>
				<td colspan="3"><input name="ch_type" type="radio" value="0" />&nbsp;列表页栏目
					 	<input name="ch_type" type="radio" value="1" checked />&nbsp;详细页栏目</td>
			<%}%>
		</tr>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="9100" />
				<input type="hidden" name="jumpurl" value="<%=para%>" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="checkupdatefrom()"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='<%=para%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
